<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<title>标题2</title>
	<meta name="keywords" content="">
	<meta name="description" content="">
</head>
<body>
	<div>账号：<input type="text" name="" value="" class="zc"></div>
	<div>密码：<input type="password" name="" value="" class="mm"></div>
	<button class="dl">登录</button>
	显示密码:<input type="checkbox" name="" value="" id="checkbox1">

</body>
<script src="js/jquery-1.10.1.min.js"></script>
<script>

$("#checkbox1").click(function(){
	var aa = document.getElementById("checkbox1");
//	var aa = $('#sPassword').prop('checked');
	if(aa.checked){
		$(".mm").prop("type","text");
	}else{		
		$(".mm").prop("type","password");
	}
});




$('.dl').click(function(){

	$.ajax({
		type:"get",
		url:'http://datainfo.duapp.com/shopdata/userinfo.php',
		
		
		data:{status:'login',userID:$('.zc').val(),password:$('.mm').val()},
		datatype:"json",
		success:function(data){
			if(data==0){
				alert('不存在')
			}else if(data==2){
				alert('用户名密码不符')
			}else{
				alert('登陆成功')

				localStorage.setItem('userID',$('.zc').val())
				window.open('liebiao.html','_self')
			
			};
			
			
		}
	})

	localStorage.getItem('userID');
	localStorage.getItem('password');
})

</script>
</html>